package com.zahb.qadx.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.contrarywind.interfaces.IPickerViewData;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Zdw on 2020/11/16 19:56
 * 抽考试卷类别
 * {
 * "id": 812,
 * "name": "物流贸易",
 * "parentId": 0,
 * "level": 1,
 * "rootOrgId": 1001,
 * "isDelete": 0,
 * "creator": 101,
 * "createTime": "2020-11-12T03:05:22.000+0000",
 * "updator": 101,
 * "updateTime": "2020-11-12T03:07:28.000+0000",
 * "isUnused": 0,
 * "cateType": 1
 * }
 */
public class ExamCategory implements Parcelable, IPickerViewData {

    private int id;
    private String name;
    private int parentId;
    private int level;
    private int rootOrgId;
    private int isDelete;
    private int creator;
    private String createTime;
    private int updator;
    private String updateTime;
    private int isUnused;
    private int cateType;
    private List<ExamCategory> childList;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getRootOrgId() {
        return rootOrgId;
    }

    public void setRootOrgId(int rootOrgId) {
        this.rootOrgId = rootOrgId;
    }

    public int getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(int isDelete) {
        this.isDelete = isDelete;
    }

    public int getCreator() {
        return creator;
    }

    public void setCreator(int creator) {
        this.creator = creator;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public int getUpdator() {
        return updator;
    }

    public void setUpdator(int updator) {
        this.updator = updator;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public int getIsUnused() {
        return isUnused;
    }

    public void setIsUnused(int isUnused) {
        this.isUnused = isUnused;
    }

    public int getCateType() {
        return cateType;
    }

    public void setCateType(int cateType) {
        this.cateType = cateType;
    }

    public List<ExamCategory> getChildList() {
        return childList;
    }

    public void setChildList(List<ExamCategory> childList) {
        this.childList = childList;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.name);
        dest.writeInt(this.parentId);
        dest.writeInt(this.level);
        dest.writeInt(this.rootOrgId);
        dest.writeInt(this.isDelete);
        dest.writeInt(this.creator);
        dest.writeString(this.createTime);
        dest.writeInt(this.updator);
        dest.writeString(this.updateTime);
        dest.writeInt(this.isUnused);
        dest.writeInt(this.cateType);
        dest.writeList(this.childList);
    }

    public ExamCategory() {
    }

    protected ExamCategory(Parcel in) {
        this.id = in.readInt();
        this.name = in.readString();
        this.parentId = in.readInt();
        this.level = in.readInt();
        this.rootOrgId = in.readInt();
        this.isDelete = in.readInt();
        this.creator = in.readInt();
        this.createTime = in.readString();
        this.updator = in.readInt();
        this.updateTime = in.readString();
        this.isUnused = in.readInt();
        this.cateType = in.readInt();
        this.childList = new ArrayList<ExamCategory>();
        in.readList(this.childList, ExamCategory.class.getClassLoader());
    }

    public static final Parcelable.Creator<ExamCategory> CREATOR = new Parcelable.Creator<ExamCategory>() {
        @Override
        public ExamCategory createFromParcel(Parcel source) {
            return new ExamCategory(source);
        }

        @Override
        public ExamCategory[] newArray(int size) {
            return new ExamCategory[size];
        }
    };

    @Override
    public String getPickerViewText() {
        return getName();
    }
}
